How do I study for this course?

- Notes + lecture slides 
- Book
- Practice
- Take advantage of my office hours

- Second Java program: find perimeter of a circle

First logical section: introduce your variables
Input variables (Radius) + output variables (perim) + Constant (PI)

Second logical section: business logic
Implement the formula (Arithmetic expression)

Third logical section: produce an output
System.out.print

"Radius: " + radius +  ", perimeter:" + perim

Example#1: CirclePerimeter.java

- Java offers 8 primitive data types:

4 data types for integer values: byte, short, int, long
2 data types for floating point values: float, double

1 bit ---> 0 or 1 (2 unique values)

2 bits ---> 4 unique values
0	0
0	1
1	0
1	1

n bits ---> 2^n

byte uses 8 bits ---> 2^8 = 256

My recommendation: 
use int for integer values
use double for floating point values

Example#2: FloatDemo.java

Floating point literal values (23.6) in Java are treated by default as double unless you put an f or F
at the end of the value. 

Integer literal values (23) is considered by Java to be an int, unless you put l or L at the end. 
23L

1 data type for characters: char
"a" (String) and 'a' (char)
Unicode character set (16 bits ---> 2^16 = 65,000 characters)

'0' < '1' < .... < '9'		'A' < 'B' .... < 'Z'	'a' < ... < 'z'
48	49	   57		65	66	  90	97	     122

char letter1 = 'a', letter2 = 'B';
if(letter2 < letter1) ....


1 data type for boolean values: boolean (true or false)


- Remainder (%)

a % b = remainder
a = K*b + remainder
17 = 4*4 + 1 
17 % 4 = 1
12 % 4 = 0

a % b if a < b ===> a
a = 0*b + a
3 = 0*8 + 3 ===> 3 % 8 = 3

14 + 4 = 18
14.0 + 4 = 18.0

7 / 2 = 3
7.0 / 2 = 3.5

14 + 4 / 2 
---> If + goes first, answer = 9
---> If / goes first, answer = 16

int value = 12;
value =value + 1; // value += 1;
System.out.println(value); // 13















